<template>
  <div>
    <div ref="xxx">123</div>
    <button @click="btnClick">修改num</button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      num: 1
    }
  },
  created() {
    this.$nextTick(() => {
      console.log(this.$refs.xxx)
    })
  },
  activated() {
    console.log('activated')
  },
  beforeUpdate() {
    console.log('beforeUpdate')
  },
  destroyed() {
    console.log('destroyed', this.num)
  },
  methods: {
    btnClick() {
      this.num++
    }
  }
}
</script>
<style></style>
